'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    /**
     * Add seed commands here.
     *
     * Example:
     * await queryInterface.bulkInsert('People', [{
     *   name: 'John Doe',
     *   isBetaMember: false
     * }], {});
    */
     return queryInterface.sequelize.transaction(async t => {
      await queryInterface.bulkInsert("sys_post", [
        {
          post_id:1,
          post_code:"ceo",
          post_name:"董事长",
          post_sort:1,
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"",
          created_at: new Date(),
          updated_at: new Date(),
        },{
          post_id:2,
          post_code:"se",
          post_name:"项目经理",
          post_sort:2,
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"",
          created_at: new Date(),
          updated_at: new Date(),
        },{
          post_id:3,
          post_code:"hr",
          post_name:"人力资源",
          post_sort:3,
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"",
          created_at: new Date(),
          updated_at: new Date(),
        },{
          post_id:4,
          post_code:"user",
          post_name:"普通员工",
          post_sort:4,
          status:"0",
          create_by:"admin",
          update_by:"admin",
          remark:"",
          created_at: new Date(),
          updated_at: new Date(),
        }
      ], { transaction: t });
    })
  },

  down: async (queryInterface, Sequelize) => {
    /**
     * Add commands to revert seed here.
     *
     * Example:
     * await queryInterface.bulkDelete('People', null, {});
     */
     return queryInterface.sequelize.transaction(async t => {
      return await queryInterface.bulkDelete("sys_post", null, { transaction: t });
    })
  }
};
